/**
 * DListTest is responsible for the tests of DList.
 * DListTest is friend class of DList, so DListTest
 * can make deep checks after each test such as
 * checking the correct setting of the pointers in
 * DListElement.
 *
 * Note: You can check out all sources as eclipse cpp project
 *       over http://stuff-from-hell.googlecode.com/svn/trunk/cpp_ex
 *
 * @author  Benjamin Friedrich (3453464)
 * 			benjamin_friedrich@gmx.de
 * @version 1.0  13.01.2009
 */
#ifndef _DLIST_TEST_
#define _DLIST_TEST_

#include <cppunit/TestFixture.h>
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/extensions/HelperMacros.h>
#include "DList.hpp"

class DListTest : public CppUnit::TestFixture
{
	/*
	 * Construction of the test suite
	 */
	 CPPUNIT_TEST_SUITE(DListTest);
	     CPPUNIT_TEST(testStandardConstructor);
	     CPPUNIT_TEST(testCopyConstructor);
	     CPPUNIT_TEST(testStringArrayConstructor);
	     CPPUNIT_TEST(testInsert);
	     CPPUNIT_TEST(testRemove);
	     CPPUNIT_TEST(testPushBack);
	     CPPUNIT_TEST(testPushFront);
	     CPPUNIT_TEST(testPopBack);
	     CPPUNIT_TEST(testPopFront);
	     CPPUNIT_TEST(testSize);
	     CPPUNIT_TEST(testToString);
	     CPPUNIT_TEST(testClear);
	     CPPUNIT_TEST(testOperatorAssign);
	     CPPUNIT_TEST(testOperatorEqual);
	     CPPUNIT_TEST(testOperatorNotEqual);
	     CPPUNIT_TEST(testOperatorPlus);
	     CPPUNIT_TEST(testOperatorPlusEqual);
	     CPPUNIT_TEST(testOperatorSubscript);
	     CPPUNIT_TEST(testIterator);
	 CPPUNIT_TEST_SUITE_END();

	private:

		/**
		 * Tests the standard constructor of DList
		 */
		void testStandardConstructor();

		/**
		 * Tests the copy constructor of DList
		 */
		void testCopyConstructor();

		/**
		 * Tests the construction of DList with an array of character strings
		 */
		void testStringArrayConstructor();

		/**
		 * Tests the method pushBack() of DList
		 */
		void testPushBack();

		/**
		 * Tests the method pushFront() of DList
		 */
		void testPushFront();

		/**
		 * Tests the method insert() of DList
		 */
		void testInsert();

		/**
		 * Tests the method remove() of DList
		 */
		void testRemove();

		/**
		 * Tests the method popBack() of DList
		 */
		void testPopBack();

		/**
		 * Tests the method popFront() of DList
		 */
		void testPopFront();

		/**
		 * Tests the method size() of DList
		 */
		void testSize();

		/**
		 * Tests the method toString of DList
		 */
		void testToString();

		/**
		 * Tests the method clear() of DList
		 */
		void testClear();

		/**
		 * Tests the operator "=" of DList
		 */
		void testOperatorAssign();

		/**
		 * Tests the operator "==" of DList
		 */
		void testOperatorEqual();

		/**
		 * Tests the operator "!=" of DList
		 */
		void testOperatorNotEqual();

		/**
		 * Tests the operator "+" of DList
		 */
		void testOperatorPlus();

		/**
		 * Tests the operator "+=" of DList
		 */
		void testOperatorPlusEqual();

		/**
		 * Tests the operator "[]" of DList
		 */
		void testOperatorSubscript();

		/**
		 * Tests the iterator of DList
		 */
		void testIterator();

	public:

		/**
		 * Runs all tests
		 *
		 * @return  true if the tests has been successful, false otherwise
		 */
		bool run();
};
#endif
